package com.myj.jim.service.impl;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.myj.jim.dao.LogtypeDao;
import com.myj.jim.domain.Logtype;
import com.myj.jim.service.LogtypeService;

@Service
public class LogtypeServiceImpl implements LogtypeService {

	@Autowired
	private LogtypeDao logtypeDao;
	
	@Override
	public List<Logtype> getAllLogtypeList() {
		return logtypeDao.getAllLogtypeList();
	}

	@Override
	public Map<String, Object> getAllLogtypeMap() {
		
		Map<String,Object> map = new LinkedHashMap<String, Object>();
		for(Logtype lt : logtypeDao.getAllLogtypeList()){
			map.put(lt.getLogtype(), lt.getLogname());
		}
		return map;
	}

}
